package com.chenyi.algorithm.sort;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 测试排序速度
 * @author chenyi
 * @className TestSortPerformance
 * @date 2022/4/3 23:52
 */
public class TestSortPerformance {

    static int RANDOM_NUMBER_SIZE = 8000000;

    public static void main(String[] args) {

        int[] array = new int[RANDOM_NUMBER_SIZE];

        for (int i = 0; i < RANDOM_NUMBER_SIZE; i++) {
            array[i] = (int) (Math.random() * 800000000);
        }

        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        System.out.println(sdf.format(date));

        BubbleSorting.sort(array);

        Date date1 = new Date();
        System.out.println(sdf.format(date1));

    }

}
